package com.more.offer.designpatterns.adapter.adapter2;

/**
 * @author pinoc
 * @date 2021/11/4
 * @description
 */
public class TwoPlugAdapter extends ThreePlug{

	private TwoPlug twoPlug;

	public TwoPlugAdapter() {

	}

	public TwoPlugAdapter(TwoPlug twoPlug) {
		this.twoPlug = twoPlug;
	}

	@Override
	public int getPlugNum() {
		System.out.println("适配器将两脚插头转换适配成三脚插头");
		if(twoPlug.getPlugNum() != 3) {
			return 3;
		}
		return twoPlug.getPlugNum();
	}
}
